// 轮播部分
var swiperUl = document.querySelector('.swiper');
        var swiperPoints = document.querySelector('.swiper-points').children;
        var count = 1;
        //每隔一秒  改变图片的位置
        setInterval(function(){
          count++;
          // console.log(count);
          swiperUl.style.transition = 'all .4s ease';
          swiperUl.style.transform = 'translateX(-'+count*10+'%)';
          for(var i = 0 ;i < swiperPoints.length;i++){
            swiperPoints[i].setAttribute('class','');
            if(count == 4){
              swiperPoints[0].classList.add('current');
            }else{
              swiperPoints[count-1].classList.add('current');
            }
          }
        },5000)
        //count=4 实际上跑到了第5张   在本轮次结束时加上监听事件
          swiperUl.addEventListener('transitionend',function(){
            if(count >= 4){
              count = 1;
              //过渡置空
              swiperUl.style.transition = '';
              swiperUl.style.transform = 'translateX(-'+count*10+'%)';
            }
})
//导航栏的显示与消失
var navShow = document.getElementsByClassName("nav-menu")[0];
var navItem = document.getElementsByClassName("nav-item")[1].children[0];
var navMenu = document.getElementsByClassName("nav-menu")[0];
// 第二个导航
var navShow2 = document.getElementsByClassName("nav-menu2")[0];
var navItem2 = document.getElementsByClassName("nav-item")[2].children[0];
var navMenu2 = document.getElementsByClassName("nav-menu2")[0];


// 第四个导航
var navShow4 = document.getElementsByClassName("nav-menu4")[0];
var navItem4 = document.getElementsByClassName("nav-item")[5].children[0];
var navMenu4 = document.getElementsByClassName("nav-menu4")[0];
console.log(navItem)

var isShow = false;

navItem.onmouseover = function (){
	if(!isShow){
		navShow.style.display = "block";
	}
}
navMenu.onmouseover = function (){
	if(!isShow){
		navShow.style.display = "block";
	}
}
navItem.onmouseout = function (){
	if(!isShow){
		navShow.style.display = "none";
	}
}
navMenu.onmouseout = function (){
	if(!isShow){
		navShow.style.display = "none";
	}
}

navItem2.onmouseover = function (){
	if(!isShow){
		navShow2.style.display = "block";
	}
}
navMenu2.onmouseover = function (){
	if(!isShow){
		navShow2.style.display = "block";
	}
}
navItem2.onmouseout = function (){
	if(!isShow){
		navShow2.style.display = "none";
	}
}
navMenu2.onmouseout = function (){
	if(!isShow){
		navShow2.style.display = "none";
	}
}
// 第四个
navItem4.onmouseover = function (){
	if(!isShow){
		navShow4.style.display = "block";
	}
}
navMenu4.onmouseover = function (){
	if(!isShow){
		navShow4.style.display = "block";
	}
}
navItem4.onmouseout = function (){
	if(!isShow){
		navShow4.style.display = "none";
	}
}
navMenu4.onmouseout = function (){
	if(!isShow){
		navShow4.style.display = "none";
	}
}
